package com.prism.moodme.app;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import javax.swing.JPanel;
import com.prism.moodme.util.ImageHelper;
import java.awt.Dimension;



public class DayPanel extends JPanel {
/**
	 *
	 */

	private static final String defChart = "https://chart.googleapis.com/chart?&chxt=x,y,r&cht=bvs&chbh=a,5&chf=c,s,000000|bg,s,EFEFEF&chtt=Daily+Frequency+Distribution&chxl=0:|Sun|Mon|Tue|Wed|Thu|Fri|Sat&chs=300x500&chd=t:1,1,1,1,1,1,1&chf=c,s,000000|bg,s,EFEFEF|b0,lg,0,FF0000,0,0000FF,1";
	private Image image;  //  //  @jve:decl-index=0:

	/**
	 * This is the default constructor
	 */
	public DayPanel(String image) {
		super();
//		setImage(image);
		initialize();
	}

	public DayPanel() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 *
	 * @return void
	 */
	private void initialize() {
		this.setSize(new Dimension(300, 495));
		this.setPreferredSize(new Dimension(300, 495));
		setChart();
	}

	public void setChart(){
		setChart(defChart);
	}


	public void setChart(String dayChart){
		setImage(dayChart);
		repaint();
	}
    public void paint(Graphics g) {
        Graphics2D g2D = (Graphics2D)g;
        g2D.drawImage(image, 0, 0, this);

    }

    public void setImage(String image){
    	this.image = ImageHelper.loadImage(image);
    }
}
